<template>
  <div class="home">
    <van-nav-bar left-arrow>
      <template #right>
        <img src="../assets/images/首页按钮.png" alt="" />
      </template>
    </van-nav-bar>
    <div class="homeTop">
      <img src="../assets/images/首页_03.png" alt="" width="100%" />
    </div>

    <ul class="home-center">
      <li @click="$router.push('/myClients')">
        <div class="tu"><img src="../assets/images/yonghu.png" alt="" /></div>

        <h2>我的客户</h2>
        <p>MY CLIENTS</p>
      </li>
      <li @click="$router.push('/Baifang')">
        <div class="tu">
          <img src="../assets/images/客户关怀.png" alt="" />
        </div>
        <h2>客户关怀</h2>
        <p>CUSTOMER</p>
      </li>
      <li @click="msgClick">
        <div class="tu">
          <img src="../assets/images/消息中心.png" alt="" />
        </div>
        <h2>消息中心</h2>
        <p>NEWS</p>
      </li>
      <li @click="$router.push('/express')">
        <div class="tu">
          <img src="../assets/images/物流单.png" alt="" />
        </div>
        <h2>物流单</h2>
        <p>LOGISTICS</p>
      </li>
      <li @click="$router.push('/deliverGoods')">
        <div class="tu">
          <img src="../assets/images/物流单.png" alt="" />
        </div>
        <h2>发货单</h2>
        <p>DISPATCH LIST</p>
      </li>
    </ul>

    <div class="tab">
      <van-tabbar v-model="active">
        <van-tabbar-item v-if="active == 0">
          <span>系统功能</span>
          <template #icon="props">
            <img :src="props.active ? icon.active : icon.inactive" />
          </template>
        </van-tabbar-item>

        <van-tabbar-item
          :icon="require('../assets/images/个人中心.png')"
          @click="pesClick"
          >个人中心</van-tabbar-item
>
      </van-tabbar>

      <div class="circle">
        <img src="../assets/images/lianxi.png" alt="" />
        <p>联系</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {
      active: 0,
      icon: {
        active: require("../assets/images/系统功能.png"),
        inactive: require("../assets/images/矢量智能对象-2.png"),
      },
    };
  },

  methods: {
    msgClick() {
      this.$router.push("/messageCenter");
    },
    pesClick() {
      this.$router.push("/personal");
    },
  },
  components: {},
};
</script>

<style lang="less" scoped >
/deep/.van-hairline--bottom::after{
       border-bottom-width: 0 !important;
}
.home {
  margin-bottom: 60px;
}
/deep/ .van-nav-bar {
  color: #fff;
  background-color: #003399;

  .van-nav-bar__title {
    color: #fff;
  }

  .van-icon::before {
    color: #fff;
  }
  .van-nav-bar__text {
    color: #fff;
  }

  img {
    width: 50%;
  }
  .van-nav-bar__right {
    padding: 0;
  }
}

.homeTop {
  width: 100%;
  height: 140px;
  background: #003399;

  padding: 20px;
  box-sizing: border-box;
}

.home-center {
  width: 80%;

  margin: 30px auto;

  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  li {
    background-color: #fff;
    width: 48%;
    height: 200px;
    margin-bottom: 10px;
    text-align: center;
    padding: 50px 0;
    box-sizing: border-box;
    color: #666;
    .tu {
      height: 50px;
      text-align: center;
    }
    img {
      width: 30%;
    }
    h2 {
      margin-top: 10px;
    }

    p {
      margin-top: 10px;
      font-size: 14px;
    }
  }
}

.tab {
  height: 50px;
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  background-color: #fff;
  font-size: 26px;

  .circle {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -20px;
    background-color: #ffcc33;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-sizing: border-box;
    border: 4px solid #efefef;
    color: #fff;
    z-index: 99;
    font-size: 14px;
    box-sizing: border-box;

    img {
      width: 24px;
      height: 24px;
      margin-bottom: 3px;
      display: block;
    }
  }
}
</style>
